package com.matt.repository;
        import com.matt.domain.LeadsHistory;
        import org.springframework.data.jpa.repository.JpaRepository;
        import org.springframework.data.jpa.repository.Modifying;
        import org.springframework.transaction.annotation.Transactional;

        import java.util.List;

/**
 * *****************
 * Created by Ron
 * from com.matt
 * on 2018/6/13 0013.
 * ******************
 */
public interface LeadsHistoryRepository extends JpaRepository<LeadsHistory, String> {

    List<LeadsHistory> findByLeadsId(String leadsId);

    List<LeadsHistory> findByLeadsIdAndType(String leadsId,String type);

    List<LeadsHistory> findByClientelesIdAndType(String clienteleId,String  type);

    @Modifying
    @Transactional
    int deleteByLeadsId(String leadsId);

}
